Import('stampEnv')
myEnv = stampEnv.Clone()

if myEnv['BUILD_PVAR'] == True:
	pvarLibrary = myEnv.SharedLibrary('pvar', 'pvar.c')
	Return('pvarLibrary')
else:
	# Can we use hash table instead ?
	myEnv.Append(CCFLAGS = '-DMAP_USE_RBTREE -DLIST_NO_DUPLICATES')
	sources = Split("""     client.c
				customer.c
				manager.c
				reservation.c
				vacation.c
				../lib/list.c
				../lib/pair.c
				../lib/mt19937ar.c
				../lib/random.c
				../lib/rbtree.c
				../lib/thread.c
			""")
	Import('pvarLibrary')
	myEnv.Append(LIBS = [pvarLibrary])
	myEnv.Program('vacation', sources)

